import request from '@/utils/request'

export function fetchHospitalList(query) {
  return request({
    url: '/hospital/getList.json',
    method: 'get',
    params: query
  })
}

export function fetchHospital(query) {
  return request({
    url: '/hospital/get.json',
    method: 'get',
    params: query
  })
}

export function fetchHospitalDelete(query) {
  return request({
    url: '/hospital/delete.json',
    method: 'get',
    params: query
  })
}

export function fetchHospitalUpdate(opt) {
  return request({
    url: '/hospital/update.json',
    method: 'post',
    data: {
      id: opt.id,
      name: opt.name,
      city: opt.city
    }
  })
}

export function fetchHospitalAdd(opt) {
  return request({
    url: '/hospital/add.json',
    method: 'post',
    data: {
      name: opt.name,
      city: opt.city
    }
  })
}

export function hospitalBatchOrderGetList(query) {
  return request({
    url: '/hospitalBatchOrder/getList.json',
    method: 'get',
    params: query
  })
}

export function hospitalBatchOrderReport(query) {
  return request({
    url: '/hospitalBatchOrder/report.json',
    method: 'get',
    params: query
  })
}

export function factoryBalingDetailList(query) {
  return request({
    url: '/factoryBaling/getDetailList.json',
    method: 'get',
    params: query || {}
  })
}
